package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@LagouController
@LagouRequestMapping("/demo")
@Security(user = {"liuc","admin"})
public class DemoController {

    @LagouAutowired
    private IDemoService demoService;

    @LagouRequestMapping("/handle1")
    public String handle1(HttpServletRequest request, HttpServletResponse response,String name) {
        return demoService.handle1(name);
    }

    @Security(user = "admin")
    @LagouRequestMapping("/handle2")
    public String handle2(HttpServletRequest request, HttpServletResponse response,String name) {
        return demoService.handle2(name);
    }


}
